package cn.tedu.shoot;

import java.awt.image.BufferedImage;
import java.util.Random;

/**
 * 小蜜蜂:是飞行物
 */
public class Bee extends FlyingObject {
    private int xSpeed;    //x坐标移动速度
    private int ySpeed;    //y坐标移动速度
    private int awardType; //奖励类型
    public Bee(){
        super(60,51);
        Random rand = new Random();
        xSpeed = 1;
        ySpeed = 2;
        awardType = rand.nextInt(2);
    }
    private int index = 1;

    public BufferedImage getImage(){
        if(isLive()){
            return  Images.bees[0];
        }else if(isDead()) {
            BufferedImage img = Images.bees[index++];
            if(index==Images.bees.length){
                state = REMOVE;
            }
            return img;
        }
        return null;
    }
}
